Add dbOwner role for _restore database to mongo-init.sh script#175
Add dbOwner role for _restore database to mongo-init.sh script#175anoppe wants to merge 1 commit intolinuxserver:mainfrom
Conversation
When restoring an installation from backup, the unifi network application tries to drop the `${MONGODB_DBNAME}_restore` database, which fails because the user used to authenticate with MonboDB doesn't have the permissions to do so.
|
I am a bot, here is the pushed image/manifest for this PR:
|
|
I confirm that this issue exists and the change in this PR resolves the issue. I just did a clean deployment and successfully restored from a backup. Tested with MongoDB 4.4.30 and UniFi Network Application 10.1.85. However, there is one more issue. UniFi Network Application tries to check the status of MongoDB at startup and does not have permission to do so. This issue can be easily fixed by adding another role. In my environment, I fixed it by adding the It would be great to solve this issue as well. |
Description:
When restoring an installation from backup, the unifi network application tries to drop the
${MONGODB_DBNAME}_restoredatabase, which fails because the user used to authenticate with MonboDB doesn't have the permissions to do so.Benefits of this PR and context:
By adding ownership to the
${MONGODB_DBNAME}_restoredatabase, the restore-from-backup functionality should work.How Has This Been Tested?
Unfortunately, I had do a fresh installation of the Unifi network application, and when trying to restore from backup, nothing happened.
The logs showed me that the application was unauthorized to drop the
${MONGODB_DBNAME}_restoredatabase:Source / References: